<template>
	<view style="width: 100%;height: 100%;background-color: #fff;display: flex;flex-direction: column;align-items: center;">
		<view style="width: 650rpx;margin-left: 50rpx;margin-right: 50rpx;display: flex;flex-direction: row;justify-content: center;margin-top: 20rpx;">
			<view style="width: 33.3%;text-align: center;font-size:26rpx ;font-weight: 700;"
			 v-for="(item,index) in tabList" :class="xuanZhongIndex==index?'xuanZhong':'buXuanZhong'"
			 
			 @click="xuanZhong(index)">
				{{item.name}}
			</view>
		</view>
		
		<view style="width: 650rpx;margin-left: 50rpx;margin-right: 50rpx;margin-top: 40rpx;">
			<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
				<view style="width: 120rpx;color: #000; font-weight: 700;">
					计算方式
				</view>
				<view style="width: 530rpx;display: flex;flex-direction: row;justify-content: center;">
						<radio-group @change="radioChange" style="display: flex;flex-direction: row;justify-content: center;">
							<view style="font-size: 22rpx;color: #777777;width: 200rpx;display: flex;flex-direction: row;align-items: center; " v-for="(item, index) in radioList" :key="item.value">
								<view>
									<radio color="#038cff"  :value="item.value" :checked="index === current" />
								</view>
								<view>{{item.name}}</view>
							
							</view>	
						</radio-group>	
				</view>
			
			</view>
		</view>
		
		<view style="width: 650rpx;margin-left: 50rpx;margin-right: 50rpx;display: flex;flex-direction: column;" 
		v-if="current==0 && xuanZhongIndex==0">
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						商贷金额
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
							<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入金额"/>
							<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">万</view>
					</view>
				
				</view>
			</view>
			
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						利率方式
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<uni-data-select style="width: 350rpx;" :localdata="liLvFangShiList"
								 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						借贷年限
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<uni-data-select style="width: 350rpx;" :localdata="jieDaiNianXianList"
								 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						商贷利率
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<uni-data-select style="width: 350rpx;" :localdata="shangDaiLiLvList"
								 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
			
			
		</view>
		
		
		<view style="width: 650rpx;margin-left: 50rpx;margin-right: 50rpx;display: flex;flex-direction: column;"
		v-if="current==1 && xuanZhongIndex==0">
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						房屋总价
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
							<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入总价"/>
							<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">万</view>
					</view>
				
				</view>
			</view>
			
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						贷款比例
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入比例"/>
						<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">成</view>
					</view>
				
				</view>
			</view> 
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						商贷金额
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入金额"/>
						<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">万</view>
					</view>
				
				</view>
			</view> 
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						利率方式
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<uni-data-select style="width: 350rpx;" :localdata="liLvFangShiList"
								 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						借贷年限
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<uni-data-select style="width: 350rpx;" :localdata="jieDaiNianXianList"
								 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						商贷利率
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<uni-data-select style="width: 350rpx;" :localdata="shangDaiLiLvList"
								 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
		</view>
		
		
		
		
		
		<view style="width: 650rpx;margin-left: 50rpx;margin-right: 50rpx;display: flex;flex-direction: column;"
		v-if=" xuanZhongIndex==1">
		
			<view style="width: 650rpx;" v-if="current==1">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						房屋总价
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
							<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入总价"/>
							<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">万</view>
					</view>
				
				</view>
			</view>
			
			<view style="width: 650rpx;"  v-if="current==1">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						贷款比例
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
							<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入比例"/>
							<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">成</view>
					</view>
				
				</view>
			</view>
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						贷款总额
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
							<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入金额"/>
							<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">万</view>
					</view>
				
				</view>
			</view>
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 230rpx;color: #000; font-weight: 700;">
						公积金贷款金额
					</view>
					<view style="width: 420rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
							<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入金额"/>
							<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">万</view>
					</view>
				
				</view>
			</view>
			
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 230rpx;color: #000; font-weight: 700;">
						公积金利率
					</view>
					<view style="width: 420rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
					
						<uni-data-select style="width: 350rpx;" :localdata="gjjList"
								 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						公积金年限
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
					<uni-data-select style="width: 350rpx;" :localdata="jieDaiNianXianList"
							 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						商贷金额
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入金额"/>
						<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">万</view>
					</view>
				
				</view>
			</view> 
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						利率方式
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<uni-data-select style="width: 350rpx;" :localdata="liLvFangShiList"
								 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						借贷年限
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<uni-data-select style="width: 350rpx;" :localdata="jieDaiNianXianList"
								 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						商贷利率
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
						<uni-data-select style="width: 350rpx;" :localdata="shangDaiLiLvList"
								 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
		</view>
		
		<view style="width: 650rpx;margin-left: 50rpx;margin-right: 50rpx;display: flex;flex-direction: column;"
		v-if="xuanZhongIndex==2">
		
			<view style="width: 650rpx;" v-if="current==1">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						房屋总价
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
							<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入总价"/>
							<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">万</view>
					</view>
				
				</view>
			</view>
			
			<view style="width: 650rpx;"  v-if="current==1">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						贷款比例
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
							<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入比例"/>
							<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">成</view>
					</view>
				
				</view>
			</view>
			
		
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 230rpx;color: #000; font-weight: 700;">
						公积金贷款金额
					</view>
					<view style="width: 420rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
							<input style="font-size: 24rpx; width: 120rpx;" placeholder="请输入金额"/>
							<view style="color: #000;margin-left: 5rpx;font-size: 24rpx;">万</view>
					</view>
				
				</view>
			</view>
			
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 230rpx;color: #000; font-weight: 700;">
						公积金利率
					</view>
					<view style="width: 420rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
					
						<uni-data-select style="width: 350rpx;" :localdata="gjjList"
								 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
			
			<view style="width: 650rpx;">
				<view style="width: 100%;height: 100rpx;border-bottom: 1rpx solid #e2e2e2;display: flex;flex-direction: row;align-items: center;">
					<view style="width: 120rpx;color: #000; font-weight: 700;">
						公积金年限
					</view>
					<view style="width: 530rpx;display: flex;flex-direction: row;
					justify-content: flex-end;align-items: center;">
						
					<uni-data-select style="width: 350rpx;" :localdata="jieDaiNianXianList"
							 :clear="false"></uni-data-select>
					</view>
				
				</view>
			</view> 
		
		</view>
		
		
		
		<view style="width: 550rpx;margin: 100rpx;background-color: #038cff;height: 80rpx;line-height: 80rpx;
		color: #fff;font-size: 29rpx;text-align: center;font-weight: 700;border-radius: 10rpx;">
			开始计算
		</view>
	</view>
</template>

<script>
	var that;
	export default {
		data() {
			return {
				tabList:[
					{name:'商业贷款',id:1},
					{name:'组合贷款',id:2},
					{name:'公积金贷款',id:3}],
			
					  radioList: [{
					                    value: 'USA',
					                    name: '按贷款总额',
					                    checked: 'true'
					                },
					                {
					                    value: 'CHN',
					                    name: '按房屋总价'
					                }
					            ],
				xuanZhongIndex:0,
				current:0,
				liLvFangShiList:[ { value: 0, text: "按旧版基准利率" },
				{ value: 1, text: "按LPR" }],
				shangDaiLiLvList:[ { value: 0, text: "旧版基准利率上浮10%(5.39%)" }],
				jieDaiNianXianList:[ { value: 0, text: "1年" },
				{ value: 1, text: "2年" }, { value: 0, text: "3年" }, { value: 0, text: "10年" }, { value: 0, text: "30年" }],
				gjjList:[ { value: 0, text: "最新基准利率(3.575%)" },
				{ value: 1, text: "最新基准利率(3.1%)" }],
			}
		},
		onLoad() {
			that = this;
		},
		methods: {
			xuanZhong(index){
				that.xuanZhongIndex=index;
			},
			radioChange: function(evt) {
			            for (let i = 0; i < this.radioList.length; i++) {
			                if (this.radioList[i].value === evt.detail.value) {
			                    this.current = i;
			                    break;
			                }
			            }
						console.log("当前选中的是=",that.current)
			}
		}
	
	}
</script>

<style>
	.xuanZhong{
		color: #038cff;
	}
	.buXuanZhong{
		color: #333333;
	}
</style>